package com.qianlima.upload.infrastructure.core.config.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * @description:
 * @author：allms
 * @date: 2023/3/31 12:22
 */
@ConfigurationProperties(prefix = "file.local")
@Configuration
@Data
public class LocalProperties {

    /**
     * 文件路径
     */
    private String path;

    /**
     * minio地址+端口号
     */
    private String url;

    /**
     * 文件桶的名称
     */
    private String bucketName;


    public String getUrl() {
        return this.url + this.bucketName;
    }

    public String getUrl(boolean isShowBucketName) {
        return isShowBucketName ? this.url + this.bucketName : this.url;
    }

    public String getUploadPath() {
        return this.path + this.bucketName;
    }


}
